using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

using FreeFlow.Administration;
using FreeFlow.WinFormsControls.HelperClasses;
using System.Data.OleDb;
using System.Data.Odbc;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for ColumnControl.
	/// </summary>
	public class ColumnControl : AdminUserControl
	{
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.TextBox nameLabel;
    private System.Windows.Forms.Label dataTypeLabel;
    private System.Windows.Forms.TextBox dataTypeValueLabel;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox sizeLabel;
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ColumnControl()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      this.label1 = new System.Windows.Forms.Label();
      this.nameLabel = new System.Windows.Forms.TextBox();
      this.dataTypeLabel = new System.Windows.Forms.Label();
      this.dataTypeValueLabel = new System.Windows.Forms.TextBox();
      this.label2 = new System.Windows.Forms.Label();
      this.sizeLabel = new System.Windows.Forms.TextBox();
      this.SuspendLayout();
      // 
      // label1
      // 
      this.label1.Location = new System.Drawing.Point(8, 8);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(40, 16);
      this.label1.TabIndex = 0;
      this.label1.Text = "Name:";
      // 
      // nameLabel
      // 
      this.nameLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.nameLabel.BorderStyle = System.Windows.Forms.BorderStyle.None;
      this.nameLabel.Location = new System.Drawing.Point(72, 8);
      this.nameLabel.Name = "nameLabel";
      this.nameLabel.ReadOnly = true;
      this.nameLabel.Size = new System.Drawing.Size(508, 13);
      this.nameLabel.TabIndex = 1;
      this.nameLabel.Text = "nameLabel";
      // 
      // dataTypeLabel
      // 
      this.dataTypeLabel.Location = new System.Drawing.Point(8, 24);
      this.dataTypeLabel.Name = "dataTypeLabel";
      this.dataTypeLabel.Size = new System.Drawing.Size(56, 16);
      this.dataTypeLabel.TabIndex = 2;
      this.dataTypeLabel.Text = "Data type:";
      // 
      // dataTypeValueLabel
      // 
      this.dataTypeValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.dataTypeValueLabel.BorderStyle = System.Windows.Forms.BorderStyle.None;
      this.dataTypeValueLabel.Location = new System.Drawing.Point(72, 24);
      this.dataTypeValueLabel.Name = "dataTypeValueLabel";
      this.dataTypeValueLabel.ReadOnly = true;
      this.dataTypeValueLabel.Size = new System.Drawing.Size(508, 13);
      this.dataTypeValueLabel.TabIndex = 3;
      this.dataTypeValueLabel.Text = "dataTypeValueLabel";
      // 
      // label2
      // 
      this.label2.Location = new System.Drawing.Point(8, 40);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(40, 16);
      this.label2.TabIndex = 4;
      this.label2.Text = "Size:";
      // 
      // sizeLabel
      // 
      this.sizeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.sizeLabel.BorderStyle = System.Windows.Forms.BorderStyle.None;
      this.sizeLabel.Location = new System.Drawing.Point(72, 40);
      this.sizeLabel.Name = "sizeLabel";
      this.sizeLabel.ReadOnly = true;
      this.sizeLabel.Size = new System.Drawing.Size(508, 13);
      this.sizeLabel.TabIndex = 5;
      this.sizeLabel.Text = "sizeLabel";
      // 
      // ColumnControl
      // 
      this.Controls.Add(this.sizeLabel);
      this.Controls.Add(this.label2);
      this.Controls.Add(this.dataTypeValueLabel);
      this.Controls.Add(this.dataTypeLabel);
      this.Controls.Add(this.nameLabel);
      this.Controls.Add(this.label1);
      this.Name = "ColumnControl";
      this.Size = new System.Drawing.Size(592, 304);
      this.ResumeLayout(false);
      this.PerformLayout();

    }
		#endregion

    public void LoadColumn(Column column)
    {
      nameLabel.Text = column.Name;
      dataTypeValueLabel.Text = column.DatabaseType;
      sizeLabel.Text = column.Size.ToString();
    }
	}
}
